-- include_additional
-- created by shuzy
-- 道具描述：包含额外效果（绿字）的描述

return {
    -- 获取道具详细信息
    getDetail = function(itemId, args, para)
        assert(type(args) == "table", "detail_args期望是table类型。");

        local desc = args.base_script or "";
        local dbase = PropertyM.query(itemId, "dbase");
        local maxUseTimes = dbase["max_times"] or 0;
        local propertyUsed = ME.user.dbase:query("property_used", {});
        local usedTimes = propertyUsed[itemId] or 0;
        desc = string.format(desc, maxUseTimes - usedTimes, maxUseTimes);

        local additional_script = args.additional_script;
        if additional_script and additional_script ~= "" then
            desc = desc .. "\n[green]" .. additional_script .. "[-]";
        end

        return desc;
    end,
};
